/*
 * Lenovo Group
 * Copyright (c) 2015-2016 All Rights Reserved.
 * Project Name: lmrp-android app
 * Create Time: 16-2-16 下午6:38
 */

package com.lenovo.mso2o.entity;

import com.lenovo.mso2o.conf.MSConstants;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by ligang on 2016/1/19.
 */
public class OrderListRequest implements Serializable{
    //3.3获取工单列表
    private int page;
    private int limit;
    private String timerange;
    private int status;
    private String project;
    private String sort;
    private String includes;
    private List<OrderRectangle> rectangle = new ArrayList<>();
    private String key;

    public OrderListRequest() {
        super();
        clear();
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getTimerange() {
        return timerange;
    }

    public void setTimerange(String timerange) {
        this.timerange = timerange;
    }

    public String getProject() {
        return project;
    }

    public void setProject(String project) {
        this.project = project;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getIncludes() {
        return includes;
    }

    public void setIncludes(String includes) {
        this.includes = includes;
    }

    public List<OrderRectangle> getRectangle() {
        return rectangle;
    }

    public void setRectangle(List<OrderRectangle> rectangle) {
        this.rectangle = rectangle;
    }

    @Override
    public String toString() {
        return "OrderListRequest{" +
                "page=" + page +
                ", limit=" + limit +
                ", timerange='" + timerange + '\'' +
                ", status=" + status +
                ", project='" + project + '\'' +
                ", sort='" + sort + '\'' +
                ", includes='" + includes + '\'' +
                ", rectangle=" + rectangle +
                '}';
    }

    public void clear() {
        setPage(MSConstants.ListParamConstants.page_default);
        setStatus(2);
        setIncludes(null);
        setLimit(MSConstants.ListParamConstants.pageSize_default);
        setProject(null);
        setSort(null);
        setTimerange(null);
    }

    public void from(OrderListRequest request) {
        setPage(request.getPage());
        setTimerange(request.getTimerange());
        setSort(request.getSort());
        setProject(request.getProject());
        setIncludes(request.getIncludes());
        setLimit(request.getLimit());
        setRectangle(request.getRectangle());
        setStatus(request.getStatus());
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getKey() {
        return key;
    }
}
